<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport"
	content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<script src="jquery.min.js"></script>
<script src="vue.min.js"></script>
<style type="text/css">
a {
	display: block;
}
</style>

<title></title>
</head>
<body>
	<div>
		<a v-for="(index,item) in items" data-index="{{index}}"
			v-on:click="onclick" href="http://www.baidu.com">{{ item.text }}</a>
	</div>
	<input type="text" name="" id="index" value="" />
	<script type="text/javascript">
		new Vue({
			el : 'body',
			data : {
				items : [ {
					text : '巴士'
				}, {
					text : '快车'
				}, {
					text : '专车'
				}, {
					text : '顺风车'
				}, {
					text : '出租车'
				}, {
					text : '代驾'
				} ]
			},
			methods : {
				onclick : function(event) {
					event.preventDefault();
					let
					target = event.target
					console.log(target.getAttribute("data-index"));
					document.getElementById('index').value = target
							.getAttribute("data-index");
				}
			}
		})
	</script>
</body>

</html>